package de.tum.in.elitese.wahlsys.common.data;

/**
 * Container for all credentails of a user of the system (staff or booth)
 * 
 * @author christoph
 */
public class UserCredentials {
	private String fRegionId;
	private String fUser;
	private UserType fUserType;

	/**
	 * The constructor.
	 * 
	 * @param user
	 *            the user name
	 * @param userType
	 *            the type of the user
	 * @param regionId
	 *            the id of the election office
	 */
	public UserCredentials(String user, UserType userType, String regionId) {
		super();
		fUserType = userType;
		fRegionId = regionId;
		fUser = user;
	}

	/**
	 * Overridden for maps etc.
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof UserCredentials) {
			return fUser == ((UserCredentials) obj).fUser;
		}
		return super.equals(obj);
	}

	public String getUser() {
		return fUser;
	}

	public UserType getUserType() {
		return fUserType;
	}

	public String getRegionId() {
		return fRegionId;
	}
}
